﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using MDL;

namespace BLL
{
    public class BLL_ConsumerDetails
    {
        /// <summary>
        /// 查询商品消费
        /// </summary>
        /// <param name="cd"></param>
        /// <returns></returns>
        public static List<ConsumerDetail> select_ConsumerDetail(ConsumerDetail cd)
        {
            return DAL_ConsumerDetails.select_ConsumerDetail(cd);
        }
        /// <summary>
        /// 根据餐桌ID获取消费详细信息
        /// </summary>
        /// <param name="TableId">餐桌ID</param>
        /// <returns>餐桌的消费详细信息</returns>
        public static List<ConsumerDetail> SelectConsumerDetails(int TableId)
        {
            return DAL_ConsumerDetails.SelectConsumerDetails(TableId);
        }
        /// <summary>
        /// 修改正常菜品退菜
        /// </summary>
        /// <param name="CBID">账单编号</param>
        /// <param name="Pid">菜品ID</param>
        /// <returns>受影响的行数</returns>
        public static int UpdateConsumerDetail(string CBID, int Pid)
        {
            return DAL_ConsumerDetails.UpdateConsumerDetail(CBID, Pid);
        }
        /// <summary>
        /// 增加保存菜品信息
        /// </summary>
        /// <param name="c">菜品信息对象</param>
        /// <returns>受影响的行数</returns>
        public static int AddConsumerDetail(ConsumerDetail c)
        {
            return DAL_ConsumerDetails.AddConsumerDetail(c);
        }
        /// <summary>
        /// 根据账单编号查询详细消费
        /// </summary>
        /// <param name="CBID">账单编号</param>
        /// <returns>详细消费</returns>
        public static List<ConsumerDetail> SelectXX(string CBID)
        {
            return DAL_ConsumerDetails.SelectXX(CBID);
        }
        /// <summary>
        /// 修改已点菜品信息状态
        /// </summary>
        /// <param name="CBID">账单编号</param>
        /// <param name="ProdcutID">产品ID</param>
        /// <returns></returns>
        public static int UpdateConsumerDetailCDType(string CBID, int ProdcutID)
        {
            return DAL_ConsumerDetails.UpdateConsumerDetailCDType(CBID, ProdcutID);
        }       
    }
}
